package com.ruoyi.project.mydy.dimensionrank.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.dimensionrank.mapper.DlDimensionRankMapper;
import com.ruoyi.project.mydy.dimensionrank.domain.DlDimensionRank;
import com.ruoyi.project.mydy.dimensionrank.service.IDlDimensionRankService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 维度排行Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlDimensionRankServiceImpl implements IDlDimensionRankService 
{
    @Autowired
    private DlDimensionRankMapper dlDimensionRankMapper;

    /**
     * 查询维度排行
     * 
     * @param id 维度排行主键
     * @return 维度排行
     */
    @Override
    public DlDimensionRank selectDlDimensionRankById(Long id)
    {
        return dlDimensionRankMapper.selectDlDimensionRankById(id);
    }

    /**
     * 查询维度排行列表
     * 
     * @param dlDimensionRank 维度排行
     * @return 维度排行
     */
    @Override
    public List<DlDimensionRank> selectDlDimensionRankList(DlDimensionRank dlDimensionRank)
    {
        return dlDimensionRankMapper.selectDlDimensionRankList(dlDimensionRank);
    }

    /**
     * 新增维度排行
     * 
     * @param dlDimensionRank 维度排行
     * @return 结果
     */
    @Override
    public int insertDlDimensionRank(DlDimensionRank dlDimensionRank)
    {
        dlDimensionRank.setCreateTime(DateUtils.getNowDate());
        return dlDimensionRankMapper.insertDlDimensionRank(dlDimensionRank);
    }

    /**
     * 修改维度排行
     * 
     * @param dlDimensionRank 维度排行
     * @return 结果
     */
    @Override
    public int updateDlDimensionRank(DlDimensionRank dlDimensionRank)
    {
        return dlDimensionRankMapper.updateDlDimensionRank(dlDimensionRank);
    }

    /**
     * 批量删除维度排行
     * 
     * @param ids 需要删除的维度排行主键
     * @return 结果
     */
    @Override
    public int deleteDlDimensionRankByIds(String ids)
    {
        return dlDimensionRankMapper.deleteDlDimensionRankByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除维度排行信息
     * 
     * @param id 维度排行主键
     * @return 结果
     */
    @Override
    public int deleteDlDimensionRankById(Long id)
    {
        return dlDimensionRankMapper.deleteDlDimensionRankById(id);
    }
}
